Skip to main content

Type Alias: MutationResult<TFuncName, TData, TError, TVariables, TContext>

MutationResult<TFuncName, TData, TError, TVariables, TContext>: Omit<UseMutationResult<TData, TError, TVariables, TContext>, "mutateAsync"> & { [P in TFuncName]: UseMutationResult<TData, TError, TVariables, TContext>["mutateAsync"] }

See Tanstack Query - useMutation returns.

Type Parameters

TFuncName extends string

The name of the function that mutates.

TData

The data returned.

TError

The error returned.

TVariables

The variables used in the mutation.

TContext = unknown

The context used in the mutation.

See

Tanstack Query - useMutation

Example

mutateAsync is renamed according to the TFuncName and therefore not included in the result.

const {
data,
error,
isError,
isIdle,
isPending,
isPaused,
isSuccess,
failureCount,
failureReason,
mutate,
- mutateAsync,
reset,
status,
submittedAt,
variables,
} = useMutationHook();

Used By

useLinkAddress

usePlaceOrder

Defined in

types.ts:247